package com.zhanqiao.service;

import com.zhanqiao.Dao.SelectAllVipDao;
import com.zhanqiao.Dao.VipDao;
import com.zhanqiao.domain.VipBean;
import org.omg.PortableInterceptor.INACTIVE;

import java.sql.SQLException;
import java.util.List;

public class SelectVipService implements VipService {
    @Override
    public List<VipBean> getVips(String page, String limit) {
        VipDao vipDao = new SelectAllVipDao();
        return vipDao.selectAll(page, limit);
    }

    public Long findCount() throws SQLException {
        return new SelectAllVipDao().findCount();
    }
    public Integer saveService( VipBean vipBean) throws SQLException {
        SelectAllVipDao vipDao =new SelectAllVipDao();
        return vipDao.updataVipS(vipBean);
    }

    public Integer deleteService(Integer vid) throws SQLException {
        SelectAllVipDao dao = new SelectAllVipDao();
        return dao.deleteVips(vid);
    }

    public Integer addService(VipBean vipBean) throws SQLException {
        return new SelectAllVipDao().insertVip(vipBean);
    }
}
